<?php
//300s
require_once __DIR__ . '/../../autoload.php';
use  src\DataBase;
if(is_file('./courses/write.json') && (time()-filemtime('./courses/write.json') < 10)) {    //触发静态页面的生成

}else{
	$db= new DataBase\DataBaseOperate('139.196.124.180','school','user1','Mcx857264','utf8');
	$selectResult=$db->select('course','*');
	var_dump($selectResult);
    $output=json_encode($selectResult);
	$file=file_put_contents('./courses/write.json', $output); 
    var_dump($file);
}

?>